﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Modules.zoo {
    import flash.utils.*;
    import Classes.*;

    public class ZooManager {

        public static const MECHANIC_SLOTS:String = "slots";
        public static const MECHANIC_STORAGE:String = "storage";
        public static const MECHANIC_DIALOG_GENERATOR:String = "dialogGenerator";
        public static const MECHANIC_REWARDS_DIALOG:String = "rewardsDialog";
        public static const COMMON:String = "common";
        public static const RARE:String = "rare";
        public static const UNCOMMON:String = "uncommon";
        public static const ZOO_UNLOCK:String = "zooUnlock_";

        public function getAllAnimals(_arg1:String=""):Array{
            var _local2:Array;
            if (_arg1){
                _local2 = Global.gameSettings.getItemsByKeywords([_arg1]);
            } else {
                _local2 = Global.gameSettings.getItemsByKeywords(["zoo_animal"]);
            };
            return (_local2);
        }
        public function getAllAnimalsByRarity(_arg1:String):Dictionary{
            var _local4:Item;
            var _local2:Array = this.getAllAnimals(_arg1);
            var _local3:Dictionary = new Dictionary();
            _local3[ZooManager.COMMON] = [];
            _local3[ZooManager.UNCOMMON] = [];
            _local3[ZooManager.RARE] = [];
            for each (_local4 in _local2) {
                switch (_local4.rarity){
                    case ZooManager.COMMON:
                        _local3[ZooManager.COMMON].push(_local4.name);
                        break;
                    case ZooManager.UNCOMMON:
                        _local3[ZooManager.UNCOMMON].push(_local4.name);
                        break;
                    case ZooManager.RARE:
                        _local3[ZooManager.RARE].push(_local4.name);
                        break;
                };
            };
            return (_local3);
        }
        public function isAnimal(_arg1:String):Boolean{
            var _local2:Item = Global.gameSettings.getItemByName(_arg1);
            return (((_local2) && (_local2.itemHasKeyword("zoo_animal"))));
        }

    }
}//package Modules.zoo 
